package com.rzj.demo.demos.mapper;

import com.rzj.demo.demos.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ArticleInfoMapper {
    @Select("select * from articleinfo where id=#{articleId}")
    ArticleInfo selectById(Integer articleId);

    /*
      多表查询
     */
    @Select("select ta.*,tb.username,tb.age from articleinfo ta left join user_info tb on ta.uid=tb.id where ta.id = 1")
    ArticleInfo selecArticleAndUsertById(Integer articleId);
}
